package com.zhao.dota.security.store;

import com.zhao.dota.bo.AuthenticateUser;
import com.zhao.dota.security.token.AccessToken;

public interface TokenStore {

    AccessToken readAccessToken(String token);

    AuthenticateUser readAuthentication(AccessToken accessToken);

    AuthenticateUser readAuthentication(String token);

    void storeAccessToken(AccessToken token, AuthenticateUser authentication);

    void removeAccessToken(AccessToken token);

    void removeAccessToken(String token);

    void storeRefreshToken(String refreshToken, AuthenticateUser authentication);

    String readRefreshToken(String tokenValue);

    AuthenticateUser readAuthenticationForRefreshToken(String refreshToken);

    void removeRefreshToken(String refreshToken);

    void removeAccessTokenUsingRefreshToken(String refreshToken);

    AccessToken getAccessToken(AuthenticateUser authentication);

    AccessToken getAccessToken(String refreshToken);

}
